<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改系統設定資料</title>
</head>
<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/> <%//連結資料庫的bean %>
<% 
	  String sql="select * from SYS_SETTING WHERE S_ID='"+request.getParameter("id")+"'";
	  ResultSet rs=mydb.executeQuery(sql); 
	  rs.next();
      
      String S_ID = rs.getString(1);
	  String S_NAME = rs.getString(2);
      String S_VALUE = rs.getString(3);
      String S_DESC = rs.getString(4);
	  %>
	  
<table width="750" border="0" align="center">
  <tr>
    <td width="30" rowspan="4"><jsp:include page="../frameset/left.jsp" flush="true" ></jsp:include></td>
    <td colspan="2"><jsp:include page="../frameset/top.jsp" flush="true" ></jsp:include></td>
    <td width="40" rowspan="4"><jsp:include page="../frameset/right.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td rowspan="2"><jsp:include page="../frameset/mean.jsp" flush="true" ></jsp:include>

    </td>
    <td height="32"><jsp:include page="../frameset/setting_mean.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td>
    <table width="500" cellspacing="0" cellpadding="0"> 
 <tr>
    <td align="center" valign="top" bordercolor="1">
      <div align="center">  
        <table width="100%"  border="0" cellspacing="1" cellpadding="1">
          <tr>
            <td align="center" valign="top" bordercolor="#00CCFF"><div align="center"> 修改系統設定資料
            <form name="myForm" method="post" action="do_altersetting.jsp">    <%//送出表單 %>
              <table width="100%"  border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#999999">
                   
                <tr bgcolor="#FFFFCC">
                  <td width="23%"><div align="right"><span class="gytext11"><font class=cherry></font>編號：</span></div></td>
                  <td width="77%"><div align="left"><span class="lggytext11">
                      <%=S_ID%>
                    </span></div></td>
                </tr>
                
                <tr>
                  <td width="23%"><div align="right"><span class="gytext11"><font class=cherry></font>設定名稱：</span></div></td>
                  <td width="77%"><div align="left"><span class="lggytext11">
                      <%=S_NAME%>
                     </span></div></td>
                </tr>
                <tr bgcolor="#FFFFCC">
                 <td><div align="right"><span class="gytext11">設定值：</span></div></td>
                  <td><div align="left"><span class="lggytext11">
                      <textarea name="value" rows="2" cols="45"><%=S_VALUE%></textarea>
                  </span></div></td>
                </tr>
                <tr>
                 <td><div align="right"><span class="gytext11">系統設定<br>之說明：</span></div></td>
                  <td><div align="left"><span class="lggytext11">
                      <textarea name="desc" rows="2" cols="45"><%=S_DESC%></textarea>
                  </span></div></td>
                </tr>

                <tr bgcolor="#FFFFCC">
                  <td colspan="2"><div align="right">
                      <input type="hidden" value="<%=S_ID%>" name="id">
                      <input type="hidden"  name="textfield"/>
                      <input name="Submit" type="submit"  value="送出"> 
                  </div></td>
                </tr>
              </table>
            
                </form>
              </div>            </td>
          </tr>
        </table> 
    </td>
  </tr>
  <tr>
    <td colspan="2"></td>
  </tr>
</table> 
<%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
</body>
</html>